import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 用户管理模块
 */
// 获取用户列表
export const listByPage = params => {
  let data = http.post(PORT1 + `/user/listByPage`, params);
  return data;
};
export const deleteData = params => {
  return http.delete(PORT1 + `/user/deleteData?id=` + params);
};

export const addData = params => {
  return http.post(PORT1 + `/user/addUser`, params);
};

export const updateData = params => {
  return http.post(PORT1 + `/user/updateUser`, params);
};

export const queryCurrentUserRoles = params => {
  return http.get(PORT1 + `/role/queryCurrentUserRoles?userId=` + params, null);
};

export const roleAllocation = params => {
  return http.post(PORT1 + `/user/roleAllocation`, params);
};

// 生成二维码
export const getQrcode = params => {
  return http.get(PORT1 + `/qrCode/getQrcode?userId=` + params, null);
};
